#include <iostream>
#include <string>
using namespace std;

char c[127];
int main(){
	freopen("in.txt","r",stdin);	
	string s1,s2;
	cin>>s1>>s2;
	for(int i=0; i<s1.length(); ++i ){
		if( s2.find(s1[i])==string::npos ){
			char ch;
			if(  s1[i]>='a'&&s1[i]<='z' ) ch = s1[i]-('a'-'A');
			else ch = s1[i];
			++c[ch];
			if( c[ch]==1 ) cout<<ch;
		} 
	}
	return 0;
}
